import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class MapView extends JPanel{
	
	private Image img;
	private int size = 8;
	private int spotX, spotY, distance;
	private MapController mpc;
	private StatusModel sm;
	private MilestoneModel mm;
	private Image dbImage;
	private Graphics dbg;

	  public MapView(Image img) {
	    this.img = img;
	    Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
	    setPreferredSize(size);
	    setMinimumSize(size);
	    setMaximumSize(size);
	    setSize(size);
	    setLayout(null);
	  }

	  public void paintComponent(Graphics g) {
		super.paintComponents(g);
	    g.drawImage(img, 0, 0, null);
	    g.setColor(Color.blue);
	    g.fillOval((int)mpc.getPlayerX()-size/2, (int)mpc.getPlayerY()-size/2, size, size);
	  }

	public void setController(MapController controller) {
		this.mpc = controller;
		
	}

	  
}
